<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1253">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2  (Win32)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20110606;9410788">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 21cm 29.7cm; margin: 2.01cm }
		P { margin-bottom: 0.2cm }
		PRE { font-family: "Times New Roman" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="el-GR" DIR="LTR">
<PRE LANG="en-US"><FONT SIZE=5><B>The  VISAD  Matlab-like interface in ScalaLab</B></FONT>

<FONT SIZE=4><SPAN LANG="en-US">The VISAD is a powerful Data Visualization framework, that however is rather difficult to use in its native interface. </SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US">Therefore ScalaLab offers an alternative Matlab-like interface for the basic functionality of VISAD. The full potential of VISAD can be also exploited from ScalaLab by the experienced programmer by using the native VISAD interface, either with Java code or with Scala code.</SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">In the following we describe the Matlab-like interface to VISAD.  We remind that in order to utilize the rather impressive 3-D graphics of VISAD the user should install Java 3D. </SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><B>General design philosophy</B></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US">In order to present a uniform and easy to use interface to its plotting libraries ScalaLab adopts the Matlab style. For the VISAD library all the interface routines are prefixed with v, e.g. instead of <I>figure(id: Integer) </I><SPAN STYLE="font-style: normal">we have </SPAN><I>vfigure(id: Integer).</I></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>Routines</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>1.  vfigure</B></SPAN></FONT>

<A NAME="__DdeLink__0_1606627208"></A><FONT SIZE=4><SPAN LANG="en-US">Creates a frame that will be used for displaying VISAD plots.  The next in sequence id is used as figure number.</SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US">e.g.</SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val v1 = vfigure; val v2 = vfigure   // creates the vfigure 1 and vfigure 2</I></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>2.  vfigure(id: Integer)</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Creates a figure with identifier id, or focuses on figure with that id if it already exists.</SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US">e.g.</SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val v8 = vfigure(8)</I></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">3. <B>vsubplot(rowId: Integer, colId: Integer, plotId: Integer)</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Creates a grid of VISAD subplots at the current figure, consisting of <I>rowId </I>rows and <I>colId </I>columns, and focuses the plot operations at the subplot that is <I>plotId </I>in sequence, numbering rows first (according to Matlab conventions).</SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US">e.g.</SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val v8 = vfigure(8); vsubplot(2,3, 4); val t= linspace(0, 2, 4096); val x = sin(3.4*t);</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vplot(t,x); vsubplot(2,3, 2); vplot(sin(34*t)); <FONT SIZE=4><SPAN LANG="en-US">vsubplot(2,3, 1); vplot(sin(4.7*t)+4*cos(3.8*t), Color.RED)</SPAN></FONT></I></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><B>4.  vplot( x: Array[Double]), vplot(x: Vec)</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Plots a double array or a ScalaSci vector to the currently focused subplot, using line-plotting mode e.g.</SPAN></FONT>

<A NAME="__DdeLink__2_1606627208"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val  t=inc(0, 0.01, 10)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val x= sin(9.6*t)+3.4*cos(1.2*t)</I></SPAN></FONT>
<A NAME="__DdeLink__4_1606627208"></A><FONT SIZE=4><SPAN LANG="en-US"><I>vplot(x.getv)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vfigure(2); vsubplot(2,3,2); vplot(x.getv)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,4); vplot(sin(1.7*x))</I></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><B>5.  vplotPoint( x: Array[Double]), vplotPoint(x: Vec)</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Plots a double array or a ScalaSci vector to the currently focused subplot, using point plotting mode e.g.</SPAN></FONT>
<A NAME="__DdeLink__29_1606627208"></A>
<A NAME="__DdeLink__23_1606627208"></A><A NAME="__DdeLink__2_16066272081"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val  t=inc(0, 0.01, 10)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val x= sin(9.6*t)+3.4*cos(1.2*t)</I></SPAN></FONT>
<A NAME="__DdeLink__4_16066272081"></A><FONT SIZE=4><SPAN LANG="en-US"><I>vplotPoint(x.getv)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vfigure(2); vsubplot(2,3,2); vplotPoint(x.getv)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,4); vplotPoint(sin(1.7*x))</I></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>6.      vplot( x: Array[Double], y: Array[Double])</B></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><B>vplot( x: Vec, y: Array[Double])</B></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><B>vplot( x: Array[Double], y: Vec)</B></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><B>vplot( x: Vec, y: Vec)</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Plots a double array (or Vec) x vs y to the currently focused subplot, using line-plotting mode e.g.</SPAN></FONT>
<A NAME="__DdeLink__45_1606627208"></A>
<A NAME="__DdeLink__2_16066272082"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val  t=inc(0, 0.01, 10)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val x= sin(9.6*t)+3.4*cos(1.2*t)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val y= sin(2.6*x)</I></SPAN></FONT>
<A NAME="__DdeLink__48_1606627208"></A><A NAME="__DdeLink__4_16066272082"></A><FONT SIZE=4><SPAN LANG="en-US"><I>vplot(x, y)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vfigure(2); vsubplot(2,3,2); vplot(x.getv, x+y)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,4); vplot(sin(1.7*x), x-sin(9*y))</I></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><B>7.      vplot( x: Array[Double] (or Vec), y: Array[Double] (or Vec), z: Array[Double] (or Vec) )</B></SPAN></FONT></PRE><P LANG="en-US" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm; font-style: normal">
<FONT SIZE=4><B>vplot( x: Array[Double] (or Vec), y: Array[Double]
(or Vec), z: Array[Double] (or Vec), xtitle: String, ytitle: String,
ztitle: String, pointSize: Int )</B></FONT></P>
<PRE LANG="en-US" STYLE="text-align: justify"><FONT SIZE=4>Three-dimensional plot of the corresponding vectors</FONT>
<A NAME="__DdeLink__98_1606627208"></A><A NAME="__DdeLink__82_1606627208"></A><A NAME="__DdeLink__66_1606627208"></A>
<A NAME="__DdeLink__45_16066272081"></A><A NAME="__DdeLink__2_160662720821"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val  t=inc(0, 0.01, 10)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val x= sin(9.6*t)+3.4*cos(1.2*t)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val y= sin(2.6*x)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val z = x+4.5*y</I></SPAN></FONT>
<A NAME="__DdeLink__68_1606627208"></A><FONT SIZE=4><SPAN LANG="en-US"><I>vplot(x, y, z)</I></SPAN></FONT>
<A NAME="__DdeLink__48_16066272081"></A><A NAME="__DdeLink__4_160662720821"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val z2 = cos(9.2*x)+4.5*sin(0.23*y)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vfigure(2); vsubplot(2,3,2); vplot(x, y, z2)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,1); vplot(x, z, z2)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,4); vplot(z,z2, y)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,3); vplot(z,z2, y+z)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,5); vplot(x,z2, cos(0.1*(y+z)))</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2,3,6); vplot(x,sin(2.3*z2), cos(0.1*(y+z)))</I></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><B>8.      vplotXYPoints( x: Array[Double], y: Array[Double])</B></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal"><B>vplotXYPoints( x: Vec, y: Array[Double])</B></SPAN></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal"><B>vplotXYPoints( x: Array[Double], y: Vec)</B></SPAN></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal"><B>vplotXYPoints( x: Vec, y: Vec)</B></SPAN></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Plots a double array (or Vec) x vs y to the currently focused subplot, using line-plotting mode e.g.</SPAN></FONT>
<A NAME="__DdeLink__189_1606627208"></A><A NAME="__DdeLink__181_1606627208"></A><A NAME="__DdeLink__163_1606627208"></A><A NAME="__DdeLink__149_1606627208"></A><A NAME="__DdeLink__128_1606627208"></A><A NAME="__DdeLink__123_1606627208"></A><A NAME="__DdeLink__45_16066272082"></A>
<A NAME="__DdeLink__2_160662720822"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val  t=inc(0, 0.01, 10)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val x= sin(9.6*t)+3.4*cos(1.2*t)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val y= sin(2.6*x)</I></SPAN></FONT>
<A NAME="__DdeLink__48_16066272082"></A><A NAME="__DdeLink__4_160662720822"></A><FONT SIZE=4><SPAN LANG="en-US"><I>vplotXYPoints(x, y)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vfigure(2); vsubplot(2, 1, 1); vplotXYPoints(x.getv, x+y)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vsubplot(2, 1, 2); vplotXYPoints(sin(1.7*x), x-sin(9*y))</I></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><B>9.       vaddplot( x: Array[Double])</B></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal"><B>vaddplot( x: Array[Float])</B></SPAN></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal"><B>vaddplot( x: Vec)</B></SPAN></SPAN></FONT>
        <FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal"><B>vaddplot( x: Array[Double], xtitle: String, ytitle: String, pointSize: Int)  </B></SPAN></SPAN></FONT></PRE><P LANG="en-US" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm; font-style: normal">
<FONT SIZE=4><B>vaddplot( x: Array[Float], xtitle: String, ytitle:
String, pointSize: Int)</B></FONT></P>
<P LANG="en-US" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm; font-style: normal">
<FONT SIZE=4><B>vaddplot( x: Vec, xtitle: String, ytitle: String,
pointSize: Int)</B></FONT></P>
<PRE STYLE="text-align: justify">
<FONT SIZE=4>Plots without erasing other plots, i.e. with &ldquo;hold on&rdquo; mode, e.g.</FONT>

<A NAME="__DdeLink__2_1606627208221"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val  t=inc(0, 0.01, 10)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val x= sin(9.6*t)+3.4*cos(1.2*t)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val y= sin(2.6*x)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val z= 0.8*sin(12.6*x)+x</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vfigure(1)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vplot(x)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vaddplot(y)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vaddplot(z)</I></SPAN></FONT>

<A NAME="__DdeLink__2_16066272082211"></A><FONT SIZE=4><SPAN LANG="en-US"><I>val  t2=inc(0, 0.01, 20)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val x2= sin(0.96*t2)+3.4*cos(0.12*t2)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val y2= sin(1.6*x2)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>val z2= 0.8*sin(0.126*x2)+x2+2*y2</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vfigure(2)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vplot(x2, &quot;time&quot;, &quot;x2&quot;, 1 )</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vaddplot(y2, &quot;time&quot;, &quot;y2&quot;, 1)</I></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><I>vaddplot(z2, &quot;time&quot;, &quot;z2&quot;, 1)</I></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>vclose(figId: Integer)</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Closes the figure with id figId.</SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>vcloseAll</B></SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Closes all the VISAD figures.</SPAN></FONT>


</PRE>
</BODY>
</HTML>